import request from '../common/request';
import qs from 'qs';

const base: string = 'adminApi';

export async function depts() {
  return request({
    url: `${base}/depts/selectChildren`,
    method: 'get',
  });
}

export async function selectAll(params: any) {
  return request({
    url: `${base}/bosss/selectAll`,
    method: 'get',
    paramsSerializer: function(params) {
      return qs.stringify(params, { arrayFormat: 'repeat' });
    },
    params,
  });
}

export async function saveBossUser(data: any) {
  return request({
    url: `${base}/bossUsers`,
    method: 'post',
    data,
  });
}
